package com.xnyzc.lhy.didi.controller.work;

import com.xnyzc.lhy.common.entity.DiDiRv;
import com.xnyzc.lhy.didi.entity.param.work.*;
import com.xnyzc.lhy.didi.entity.param.workorder.CreateWorkOrderParam;
import com.xnyzc.lhy.didi.entity.param.workorder.UpdateWorkOrderParam;
import com.xnyzc.lhy.didi.entity.param.workorder.WorkOrderUrgentParam;
import com.xnyzc.lhy.didi.service.work.WorkOrderService;
import com.xnyzc.lhy.didi.service.work.WorkService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 滴滴调用接口
 * </p>
 *
 * @author wangshuo
 * @since 2019-10-08
 */
@RestController
@RequestMapping("oa/didi/workorder")
public class WorkOrderController {

    @Autowired
    private WorkOrderService workOrderService;

    /**
     * 新建Didi工单
     *
     * @param createWorkOrderParam
     * @return
     */
    @ApiOperation(value = "新建Didi工单", notes = "新建Didi工单")
    @PostMapping(value = "/getCreateWorkOrder")
    public DiDiRv getCreateWorkOrder(@ApiParam(name =
            "createWorkOrderParam", value = "新建Didi工单") @RequestBody CreateWorkOrderParam createWorkOrderParam) {
        return workOrderService.getCreateWorkOrder(createWorkOrderParam);
    }

    /**
     * 更新工单接口
     *
     * @param updateWorkOrderParam
     * @return
     */
    @ApiOperation(value = "更新工单接口", notes = "更新工单接口")
    @PostMapping(value = "/getUpdateWorkOrder")
    public DiDiRv getUpdateWorkOrder(@ApiParam(name =
            "updateWorkOrderParam", value = "更新工单接口") @RequestBody UpdateWorkOrderParam updateWorkOrderParam) {
        return workOrderService.getUpdateWorkOrder(updateWorkOrderParam);
    }

    /**
     * 工单加急接口
     *
     * @return
     */
    @ApiOperation(value = "工单加急接口", notes = "工单加急接口")
    @PostMapping(value = "/getWorkOrderUrgent")
    public DiDiRv getWorkOrderUrgent(@RequestBody WorkOrderUrgentParam workOrderUrgentParam) {
        return workOrderService.getWorkOrderUrgent(workOrderUrgentParam);
    }

}
